<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<jsp:useBean id="db" class="connBean.ConnDB" scope="page">
</jsp:useBean>
<%@ include file="Logined.jsp" %>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
    font-size:20px;
}
-->
.tab_content{
border-right:1px dashed #cccccc;
font-size:20px;
}
.tab_title{
color:#444444;
font-size:20px;
font-weight:bold;
text-align:center;
}
</style>
<body>
<table width="100%"  height="97%"border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" height="35" valign="top" background="images/mail_leftbg.gif"><img src="images/left-top-right.gif" width="17" height="29" /></td>
    <td valign="top" background="images/content-bg.gif"><table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31"><div class="titlebt">修改子类别</div></td>
      </tr>
    </table></td>
    <td width="16" valign="top" background="images/mail_rightbg.gif"><img src="images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td height="149" valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" height="100%" bgcolor="#F7F8F9">
    



 <%    
  int st_id=Integer.parseInt(request.getParameter("st_id"));
  db.OpenConn();
  db.createStmt(); 
  String sql="select * from second_type where st_id="+st_id;
  ResultSet rs=db.Query(sql);
int t_id=0;
  if(rs.next()){
t_id=rs.getInt("t_id");
String st_name=rs.getString("st_name");
  
%>
 <% }%> 
<form action="saveUpdateSType.jsp" method="post" ">

<table >


<tr>
<td class="tab_title"> 二级类别ID</td><td ><input type="text" name="st_id" value="<%=st_id%>" readonly/></td>
</tr>

<tr>
<td class="tab_title"> 二级类别名 </td><td ><input type="text" name="st_name" value="<%=rs.getString("st_name")%>"/></td>
</tr>
<tr>
<td class="tab_title"> 隶属主类别 </td><td ><select name="t_id" size=1>
<%
				String sql2 = "select * from main_type";//定义查询SQL语句
				System.out.print(sql2);
				ResultSet mtrs = db.Query(sql2);//执行SQL语句
				while (mtrs.next()) {
				int t_id2=mtrs.getInt("t_id");
				String  t_name=mtrs.getString(2);
				
				if(t_id2==t_id){
			%>
      <option value="<%=t_id2%>" selected> <%=t_name %> </option>
<%}else{
%>
      <option value="<%=t_id2%>" > <%=t_name %> </option>


<%} 
}%>

 
</select>



</td>
</tr>

<tr>
<td class="tab_title" colspan=2> 
 <INPUT TYPE="submit" value=" 保存 ">  
<%String ref = request.getHeader("REFERER");%> 

<input type="button" name="returngo" value="返回"   onclick="javascript:window.location='<%=ref%>'" > 
</td>
</tr>

</table>
</form>




    























</td>
    <td background="images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="images/mail_leftbg.gif"><img src="images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="images/buttom_bgs.gif"><img src="images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="images/mail_rightbg.gif"><img src="images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</body>
